			$(function(){
				// 表单验证
				$("form").validate({
					rules:{
						userphone:{required:true,rangelength:[11,11],digits:true},
						email:{required:true,email:true},
						register_password:{required:true,rangelength:[6,20]},
						register_againpass:{required:true,rangelength:[6,20],equalTo:'#register_password'}
					},
					messages:{
						userphone:{required:"请输入手机号。",rangelength:"请填写正确的手机号！",digits:"请填写正确的手机号！"},
						register_password:{required:"密码不能为空！",rangelength:"密码长度必须为6~20位！"},
						register_againpass:{required:"请再次输入密码！",rangelength:"两次输入的密码必须一致！",equalTo:"两次输入的密码必须一致！"}
					},
					errorPlacement: function(error, element) {
					$( element )
						.parent()
							.find( "span" )
								.empty()
									.append( error );
					},
					errorElement: "span"
				});
			});
		//注册成功后跳转到登陆页面
			$.validator.setDefaults({
				submitHandler: function() {
						$('#box,#bigbox').css('display','block');
						var $username = $('#email').val(),
							$userpass = $('#register_password').val(),
							person = {};
							person.name = $username;
							person.pass = $userpass;
						var obj = JSON.parse($.cookie('setPerson'));
							obj.data.push(person);
						var str = "";
							str = JSON.stringify(obj);
							$.cookie('setPerson',str);
						$('#top_cancel,#cancel').click(function(){
							$('#box,#bigbox').css('display','none');
							window.location.href = "fstvgo_home_page0.html";
						});
						$('#confirm').click(function(){
							window.location.href="land_fatvgo.html";
						});
						
    			}
			});